package string;

public class StringBuilderDemo {
    public static void main(String[] args) {
        /*
        StringBuilder builder1 = new StringBuilder();
        StringBuilder builder2 = new StringBuilder("abc");

        String str = "abc";
        StringBuilder builder3 = new StringBuilder(str);
        String str2 = builder3.toString();
         */
        StringBuilder builder = new StringBuilder("逸一时，误一世");

        builder.append(",逸久逸久罢逸零！");
        System.out.println(builder);
        //包含start不含end替换部分内容
        builder.replace(7, 16, "114514");
        System.out.println(builder);

        builder.delete(0, 8);
        System.out.println(builder);

        builder.insert(0, "1919810");
        System.out.println(builder);

        builder.reverse();
        System.out.println(builder);

    }
}
